import {BrowserRouter as Router, Switch, Route} from 'react-router-dom'
import Home from '../views/Home/Home'
import Fast from '../views/Fast/Fast'
import User from '../views/User/User'
import Error from '../views/Error/Error'
import Login from '../views/Login/Login'
import Register from '../views/Register/Register'
import Practice from '../views/Practice/Practice'
import App from '../App'

const BaseRouter = () => (
  <Router>
    <Switch>
      <Route path="/" component={()=>(
        <App>
          <Switch>
            <Route exact path="/home" component={Home}></Route>
            <Route exact path="/fast" component={Fast}></Route>
            <Route exact path="/user" component={User}></Route>
            <Route exact path="/login" component={Login}></Route>
            <Route exact path="/register" component={Register}></Route>
            <Route exact path="/practice/:actionCode" component={Practice}></Route>
            
            <Route exact component={Error}></Route>
          </Switch>
        </App>
      )}></Route>
    </Switch>
  </Router>
)

export default BaseRouter;